#{extends 'logged_user.html' /}
#{set title:'Your Handshakes' /}
<h3>My Handshakes</h3>
#{if handshakes}
<table style="width:92%">
  <tr>
    <th>Title</th>
    <th>Offerer</th>
    <th>Requester</th>
    <th>Honey Combs</th>
    <th>Status</th>
    <th></th>
  </tr>
  #{list items:handshakes, as:'handshake'}
  <tr>
      <td>
	<a href="@{Handshakes.show(handshake.id)}">
	#{if handshake.isOriginallyAnOffer}
	${handshake.offer.title}
	#{/if}
	#{else}
	${handshake.request.title}
	#{/else}
	</a>
      </td>
      <td>
	<a href="@{Users.profile(handshake.offer.user.id)}">${handshake.offer.user.fullname}</a>
      </td>
      <td>
	<a href="@{Users.profile(handshake.request.user.id)}">${handshake.request.user.fullname}</a>
      </td>
      <td>${handshake.offer.credit}</td>
      <td>${handshake.status.toString().toLowerCase()}</td>
      <td><a href="@{Handshakes.show(handshake.id)}">Details</a></td>
  </tr>
</a>
#{/list}
</table>
#{/if}
#{else}
<p>Currently you have no handshakes.</p>
#{/else}
